<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="Bookmark" href="__EXTEND__/favicon.ico" >
    <link rel="Shortcut Icon" href="__EXTEND__/favicon.ico" />
    <!--[if lt IE 9]>
    <script type="text/javascript" src="__EXTEND__/lib/html5shiv.js"></script>
    <script type="text/javascript" src="__EXTEND__/lib/respond.min.js"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="__EXTEND__/static/h-ui/css/H-ui.min.css" />
    <link rel="stylesheet" type="text/css" href="__EXTEND__/static/h-ui.admin/css/H-ui.admin.css" />
    <link rel="stylesheet" type="text/css" href="__EXTEND__/lib/Hui-iconfont/1.0.8/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="__EXTEND__/static/h-ui.admin/skin/default/skin.css" id="skin" />
    <link rel="stylesheet" type="text/css" href="__EXTEND__/static/h-ui.admin/css/style.css" />
    <!--[if IE 6]>
    <script type="text/javascript" src="__EXTEND__/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <title>病历列表</title>
    <link href="__EXTEND__/lib/lightbox2/2.8.1/css/lightbox.css" rel="stylesheet" type="text/css" >
</head>
<style type="text/css">

</style>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 用户管理 <span class="c-gray en">&gt;</span> 病历列表
    <a class="btn btn-success radius r " id="btn-refresh" style="line-height:1.6em;margin-top:3px" href="{{:U('Admin/User/userList')}}" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
    <form id="searchform" action="{{:U('Admin/User/userList')}}" method="post">
        <div class="cl">
            手机号：
            <input type="text" value="{{$searchs['user_phone']}}" name="user_phone" id="" placeholder="请输入手机号" style="width:250px" class="input-text">
            用户ID：
            <span class="select-box inline">
                <select name="sort" class="select">
                    <option value="desc" <if condition="$searchs['sort'] eq 'desc'">selected</if>>倒序</option>
                    <option value="asc" <if condition="$searchs['sort'] eq 'asc'">selected</if>>正序</option>
                </select>
            </span>
            用户类型：
            <span class="select-box inline">
                <select name="user_rank" class="select">
                    <option value="">全部</option>
                    <option value="1" <if condition="$searchs['user_rank'] eq 1">selected</if>>普通用户</option>
                    <option value="2" <if condition="$searchs['user_rank'] eq 2">selected</if>>爱心用户</option>
                    <option value="3" <if condition="$searchs['user_rank'] eq 3">selected</if>>医师用户</option>
                </select>
            </span>
            <button type="submit" class="btn btn-success" id="" name=""><i class="Hui-iconfont">&#xe665;</i> 筛选</button>
        </div>
    </form>

    <table class="table table-border table-bordered table-bg mt-20 table-sort table-hover">
        <thead>
        <tr>
            <th scope="col" colspan="10">
                <span class="l">用户列表</span>
                <span class="r">{{$page}}</span>
            </th>
        </tr>
        <tr class="text-c">
            <th width="10%">用户ID</th>       
            <th width="10%">姓名</th>
            <th width="10%">联系方式</th>
            <th width="10%">是否验证</th>
            <th width="10%">是否验证</th>
            <th width="10%">余额</th>
            <th width="10%">积分</th>
            <th width="10%">注册日期</th>
            <th width="10%">审核状态</th>
            <th width="10%">操作</th>
        </tr>
        </thead>
        <tbody>
        <foreach name="lists" item="list">
            <tr class="text-c" id='img2'>
                <td>{{$list['user_id']}}</td>
                <td>{{$list['user_name']}}</td>
                <td>{{$list['user_phone']}}</td>
                <td class="td-status">
                    <switch name="list['user_rank']">
                        <case value="1">普通用户</case>
                        <case value="2">爱心用户</case>
                        <case value="3">医师</case>
                    </switch>
                </td>
                <td><if condition='$list.is_validated eq 1'>是<else/>否</if></td>
                <td>{{$list['user_money']}}</td>
                <td>{{$list['user_integral']}}</td>
                <td>{{$list['reg_time']|time_format}}</td>
                <td class="td-status">
                    <switch name="list['status']">
                        <case value="0"><span class="label label-danger radius">未审核</span></case>
                        <case value="1"><span class="label label-success radius">审核通过</span></case>
                        <case value="2"><span class="label label-danger radius">审核不通过</span></case>
                    </switch>
                </td>
                <td class="td-manage">
                    <a style="text-decoration:none" class="ml-5" onClick="agency_edit('编辑','{{:U('Admin/User/userEdit',array('id'=>$list['user_id'],'p'=>$p))}}','650','450')" href="javascript:;" title="编辑">
                        <i class="Hui-iconfont">&#xe6df;</i>
                    </a>
                    <a style="text-decoration:none" class="ml-5" href="{{:U('Admin/User/userAccount',array('uid'=>$list['user_id']))}}" title="账目明细">
                        <i class="Hui-iconfont">&#xe63a;</i>
                    </a>
                    <a title="删除" href="javascript:;" onclick="agency_del(this,{{$list['user_id']}})" class="ml-5" style="text-decoration:none">
                        <i class="Hui-iconfont">&#xe6e2;</i></a>
                </td>
            </tr>
        </foreach>
        <tr>
            <th scope="col" colspan="9">
                <span class="r">{{$page}}</span>
            </th>
        </tr>
        </tbody>
    </table>
</div>
<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="__EXTEND__/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="__EXTEND__/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="__EXTEND__/static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="__EXTEND__/static/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="__EXTEND__/lib/lightbox2/2.8.1/js/lightbox.min.js"></script>
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="__EXTEND__/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="__EXTEND__/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="__EXTEND__/lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript">
    //  $(function(){
    //     $("#portfolio").Huihover();
    // });

    function agency_edit(title,url,w,h){
        layer_show(title,url,w,h);
    }


    function agency_del(obj,id){
        layer.confirm('确认要删除吗？',function(index){
            $.ajax({
                type: 'POST',
                url: '{{:U("Admin/User/updateStatus")}}',
                data: {
                    method:'deleteuser',
                    id : id
                },
                dataType: 'json',
                success: function(data){
                    if(data.status){
                        $(obj).parents("tr").remove();
                        layer.msg(data.info,{icon:1,time:1000});
                        setTimeout((function() {
                            window.location.href="{{:U('Admin/User/userList',array('p'=>I('p')))}}";
                        }), 500);
                    }else{
                        layer.msg(data.info,{icon:2,time:1000});
                    }
                },
                error:function(data) {
                    console.log(data.msg);
                },
            });
        });
    }

</script>
</body>
</html>